package model;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Film {

	//members
	private String id;
	private String imdb;
	private String title;
	private String year;
	private String notes;
	private String aka;
	private String duration;
	private String rating;
	private boolean isOwned;
	private boolean isSeen;
	private boolean isLoaned;

	//getters/setters
	public String getId() {
		return id;
	}
	public Film setId(String id) {
		this.id = id;
		return this;
	}
	public String getImdb() {
		return imdb;
	}
	public Film setImdb(String imdb) {
		this.imdb = imdb;
		return this;
	}
	public String getTitle() {
		return title;
	}

	public Film setTitle(String title) {
		this.title = title;
		return this;
	}
	public String getYear() {
		return year;
	}
	public Film setYear(String year) {
		this.year = year;
		return this;
	}
	public String getNotes() {
		return notes;
	}
	public Film setNotes(String notes) {
		this.notes = notes;
		return this;
	}

	public String getAKA(){
		return aka;
	}

	public Film setAKA(String aka) {
		this.aka = aka;
		return this;
	}

	public String getDuration(){
		return duration;
	}

	public Film setDuration(String duration){
		this.duration=duration;
		return this;
	}

	public String getRating(){
		return rating;
	}

	public Film setRating(String rating){
		this.rating=rating;
		return this;
	}

	public boolean getIsOwned(){
		return isOwned;
	}

	public Film setIsOwned(boolean isOwned){
		this.isOwned=isOwned;
		return this;
	}

	public boolean getIsSeen(){
		return isSeen;
	}

	public Film setIsSeen(boolean isSeen){
		this.isSeen=isSeen;
		return this;
	}

	public boolean getIsLoaned(){
		return isLoaned;
	}

	public Film setIsLoaned(boolean isLoaned){
		this.isLoaned=isLoaned;
		return this;
	}

	public static Film generateNewFilm(){

		String ts = new SimpleDateFormat("ddMMyyHHmm").format(new Timestamp(new Date().getTime()));

		Film movie = new Film()
			.setImdb(ts)
			.setAKA("The slow movie")
			.setTitle("Movie"+ts)
			.setYear("1992")
			.setNotes("test note")
			.setDuration("110")
			.setRating("10")
			.setIsOwned(false)
			.setIsSeen(false)
			.setIsLoaned(true);

		return movie;
	}

}
